var name1 = 'Bob';
Object name2 = 'Bob';
String name3 = 'Bob';
int? lineCount;
late String description;
final name = 'Bob';
final String nickname = 'Bobby';
const bar_1 = 1000000;
const double atm = 1.01325 * bar_1;
var foo = const [1, 2, 3];
final bar_2 = const [];
const baz = [];
const Object i = 3;
const list = [i as int];
const map = {if (i is int) i: 'int'};
const set = {if (list is List<int>) ...list};

(int, int) swap((int, int) record) {
  var (a, b) = record;
  return (b, a);
}

class T<_> {}

void genericFunction<_>() {}
void main(List<String> arguments) {
  description = 'Feidoada';
  print(description);
  var _ = 1;
  int _ = 2;
  for (var _ in list) {}
  try {
    throw '!';
  } catch (_) {
    print('oops');
  }
  assert(2 + 3 == 5);
  assert(2 - 3 == -1);
  assert(2 * 3 == 6);
  assert(5 / 2 == 2.5);
  assert(5 ~/ 2 == 2);
  assert(5 % 2 == 1);
  int a;
  int b;
  a = 0;
  b = ++a;
  assert(a == b);
  a = 0;
  b = a++;
  assert(a != b);
  a = 0;
  b = --a;
  assert(a == b);
  a = 0;
  b = a--;
  assert(a != b);
  assert(2 == 2);
  assert(2 != 3);
  assert(3 > 2);
  assert(2 < 3);
  assert(3 >= 3);
  assert(2 <= 3);
  var a_1 = 2;
  a_1 *= 3;
  assert(a_1 == 6);
  final value = 0x22;
  final bitmask = 0x0f;
  assert((value & bitmask) == 0x02);
  assert((value & ~bitmask) == 0x20);
  assert((value | bitmask) == 0x2f);
  assert((value ^ bitmask) == 0x2d);
  assert((value << 4) == 0x220);
  assert((value >> 4) == 0x02);
  assert((-value >> 4) == -0x03);
  assert((value >>> 4) == 0x02);
  assert((-value >>> 4) > 0);

  var x_1 = 1;
  var hex = 0xDEADBEEF;
  var y = 1.1;
  var exponents = 1.42e5;
  num x_2 = 1;
  x_2 += 2.5;
  double z = 1;
  var one = int.parse('1');
  assert(one == 1);
  var onePointOne = double.parse('1.1');
  assert(onePointOne == 1.1);
  String oneAsString = 1.toString();
  assert(oneAsString == '1');
  String piAsString = 3.14159.toStringAsFixed(2);
  assert(piAsString == '3.14');
  assert((3 << 1) == 6);
  assert((3 | 4) == 7);
  assert((3 & 4) == 0);
  const msPerSecone = 1000;
  const secondUntilRetry = 5;
  const msUntilRetry = msPerSecone * secondUntilRetry;
  var n1 = 1_000_000;
  var n2 = 0.000_000_000_01;
  var n3 = 0x00_14_22_01_23_45;
  var n4 = 555_123_4567;
  var n5 = 100__000_000__000_000;
  var s1 = 'Single quotes work well for string literals.';
  var s2 = "Double quotes work just as well.";
  var s3 = 'It\'s easy to escape the string delimiter.';
  var s4 = "It's even easier to use the other delimiter.";
  var s = 'string interpolation';
  assert(
    'Dart has $s, which is very handy.' ==
        'Dart has string interpolation, '
            'which is very handy.',
  );
  assert(
    'That deserves all caps. '
            '${s.toUpperCase()} is very handy!' ==
        'That deserves all caps. '
            'STRING INTERPOLATION is very handy!',
  );
  var s_1 =
      'String '
      'concatenation'
      " works even over line breaks";
  assert(
    s_1 ==
        'String concatenation works even over '
            'line breaks',
  );
  var s_2 = 'The + operator ' + 'works, as well.';
  assert(s_2 == 'The + operator works, as well.');
  var s__1 = '''
     You can create
     multi-line strings like this one.
  ''';
  var s__2 = """This is also a 
  multi-line string.""";
  var ss = r'In a raw string, not even \n gets special treatment.';
  const aConstNum = 0;
  const aConstBool = true;
  const aConstString = 'a constant string';
  var aNum = 0;
  var aBool = true;
  var aString = 'a string';
  const aConstList = [1, 2, 3];
  const validConstString = '$aConstNum $aConstBool $aConstString';
  var fullName = '';
  assert(fullName.isEmpty);
  var hitPoint = 0;
  assert(hitPoint == 0);
  var unicorn = null;
  assert(unicorn == null);
  var iMeantToDoThis = 0 / 0;
  assert(iMeantToDoThis.isNaN);
}

String playerName(String? name) => name != null ? name : 'Guest';
String playername(String? name) {
  if (name != null) {
    return name;
  } else {
    return 'Guest';
  }
}
